package collection.Demo06;

import java.util.Enumeration;
import java.util.Vector;

/**
 * @Author Miku
 * @Create 2021/4/13 16:20
 * Vector集合的演示
 */
public class Test {
    public static void main(String[] args) {
        //创建集合
        Vector vector = new Vector();
        //添加元素
        vector.add("草莓");
        vector.add("苹果");
        vector.add("西瓜");
        System.out.println("元素个数:"+vector.size());
        System.out.println(vector);
        //遍历集合
        Enumeration elements = vector.elements();
        while (elements.hasMoreElements()) {
            System.out.println(elements.nextElement());
        }
    }
}
